<script setup lang="ts">
import useUser from '@/store/user'
const menu = useUser().user.menu
console.log(menu)
</script>

<template>
  <div class="home_menu">
    <el-menu class="el-menu-vertical-demo" default-active="0">
      <template v-for="item in menu">
        <template v-if="!item.children">
          <el-menu-item :idnex="item.id">{{ item.title }}</el-menu-item>
        </template>
        <template v-else-if="item.children">
          <el-sub-menu>
            <template #title>
              <span>{{ item.title }}</span>
            </template>
            <el-menu-item
              :idnex="subTitle.id"
              v-for="subTitle in item.children"
            >
              {{ subTitle.title }}
            </el-menu-item>
          </el-sub-menu>
        </template>
      </template>
    </el-menu>
  </div>
</template>

<style scoped lang="scss">
.home_menu {
  height: 100%;
  background-color: aqua;
}
</style>
